Integrand size = 31, antiderivative size = 80 \[ \int (a+b \cos (c+d x)) \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\frac {1}{2} (b B+a (2 A+C)) x+\frac {(A b+a B+b C) \sin (c+d x)}{d}+\frac {(b B+a C) \cos (c+d x) \sin (c+d x)}{2 d}-\frac {b C \sin ^3(c+d x)}{3 d} \]
1/2*(B*b+a*(2*A+C))*x+(A*b+B*a+C*b)*sin(d*x+c)/d+1/2*(B*b+C*a)*cos(d*x+c)* sin(d*x+c)/d-1/3*b*C*sin(d*x+c)^3/d
Time = 0.18 (sec) , antiderivative size = 85, normalized size of antiderivative = 1.06 \[ \int (a+b \cos (c+d x)) \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\frac {6 b B c+6 a c C+12 a A d x+6 b B d x+6 a C d x+3 (4 A b+4 a B+3 b C) \sin (c+d x)+3 (b B+a C) \sin (2 (c+d x))+b C \sin (3 (c+d x))}{12 d} \]
(6*b*B*c + 6*a*c*C + 12*a*A*d*x + 6*b*B*d*x + 6*a*C*d*x + 3*(4*A*b + 4*a*B + 3*b*C)*Sin[c + d*x] + 3*(b*B + a*C)*Sin[2*(c + d*x)] + b*C*Sin[3*(c + d *x)])/(12*d)
Time = 0.37 (sec) , antiderivative size = 117, normalized size of antiderivative = 1.46, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.129, Rules used = {3042, 3502, 3042, 3213}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int (a+b \cos (c+d x)) \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \left (a+b \sin \left (c+d x+\frac {\pi }{2}\right )\right ) \left (A+B \sin \left (c+d x+\frac {\pi }{2}\right )+C \sin \left (c+d x+\frac {\pi }{2}\right )^2\right )dx\) |
\(\Big \downarrow \) 3502 |
\(\displaystyle \frac {\int (a+b \cos (c+d x)) (b (3 A+2 C)+(3 b B-a C) \cos (c+d x))dx}{3 b}+\frac {C \sin (c+d x) (a+b \cos (c+d x))^2}{3 b d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \left (a+b \sin \left (c+d x+\frac {\pi }{2}\right )\right ) \left (b (3 A+2 C)+(3 b B-a C) \sin \left (c+d x+\frac {\pi }{2}\right )\right )dx}{3 b}+\frac {C \sin (c+d x) (a+b \cos (c+d x))^2}{3 b d}\) |
\(\Big \downarrow \) 3213 |
\(\displaystyle \frac {\frac {\sin (c+d x) \left (a (3 b B-a C)+b^2 (3 A+2 C)\right )}{d}+\frac {3}{2} b x (a (2 A+C)+b B)+\frac {b (3 b B-a C) \sin (c+d x) \cos (c+d x)}{2 d}}{3 b}+\frac {C \sin (c+d x) (a+b \cos (c+d x))^2}{3 b d}\) |
(C*(a + b*Cos[c + d*x])^2*Sin[c + d*x])/(3*b*d) + ((3*b*(b*B + a*(2*A + C) )*x)/2 + ((b^2*(3*A + 2*C) + a*(3*b*B - a*C))*Sin[c + d*x])/d + (b*(3*b*B - a*C)*Cos[c + d*x]*Sin[c + d*x])/(2*d))/(3*b)
3.10.40.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.) *(x_)]), x_Symbol] :> Simp[(2*a*c + b*d)*(x/2), x] + (-Simp[(b*c + a*d)*(Co s[e + f*x]/f), x] - Simp[b*d*Cos[e + f*x]*(Sin[e + f*x]/(2*f)), x]) /; Free Q[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-C)*Co s[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(m + 2))), x] + Simp[1/(b*(m + 2)) Int[(a + b*Sin[e + f*x])^m*Simp[A*b*(m + 2) + b*C*(m + 1) + (b*B*(m + 2) - a*C)*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] && !LtQ[m, -1]
Time = 0.18 (sec) , antiderivative size = 75, normalized size of antiderivative = 0.94
method | result | size |
parallelrisch | \(\frac {3 \left (B b +C a \right ) \sin \left (2 d x +2 c \right )+C \sin \left (3 d x +3 c \right ) b +3 \left (\left (4 A +3 C \right ) b +4 B a \right ) \sin \left (d x +c \right )+12 \left (\frac {B b}{2}+a \left (A +\frac {C}{2}\right )\right ) x d}{12 d}\) | \(75\) |
parts | \(x a A +\frac {\left (A b +B a \right ) \sin \left (d x +c \right )}{d}+\frac {\left (B b +C a \right ) \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {C b \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3 d}\) | \(79\) |
risch | \(x a A +\frac {x B b}{2}+\frac {a C x}{2}+\frac {\sin \left (d x +c \right ) A b}{d}+\frac {\sin \left (d x +c \right ) B a}{d}+\frac {3 b C \sin \left (d x +c \right )}{4 d}+\frac {\sin \left (3 d x +3 c \right ) C b}{12 d}+\frac {\sin \left (2 d x +2 c \right ) B b}{4 d}+\frac {\sin \left (2 d x +2 c \right ) C a}{4 d}\) | \(101\) |
derivativedivides | \(\frac {\frac {C b \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+B b \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+C a \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+A \sin \left (d x +c \right ) b +B \sin \left (d x +c \right ) a +a A \left (d x +c \right )}{d}\) | \(102\) |
default | \(\frac {\frac {C b \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}+B b \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+C a \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+A \sin \left (d x +c \right ) b +B \sin \left (d x +c \right ) a +a A \left (d x +c \right )}{d}\) | \(102\) |
norman | \(\frac {\left (a A +\frac {1}{2} B b +\frac {1}{2} C a \right ) x +\left (a A +\frac {1}{2} B b +\frac {1}{2} C a \right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (3 a A +\frac {3}{2} B b +\frac {3}{2} C a \right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (3 a A +\frac {3}{2} B b +\frac {3}{2} C a \right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {\left (2 A b +2 B a -B b -C a +2 C b \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {\left (2 A b +2 B a +B b +C a +2 C b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {4 \left (3 A b +3 B a +C b \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}\) | \(205\) |
1/12*(3*(B*b+C*a)*sin(2*d*x+2*c)+C*sin(3*d*x+3*c)*b+3*((4*A+3*C)*b+4*B*a)* sin(d*x+c)+12*(1/2*B*b+a*(A+1/2*C))*x*d)/d
Time = 0.28 (sec) , antiderivative size = 70, normalized size of antiderivative = 0.88 \[ \int (a+b \cos (c+d x)) \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\frac {3 \, {\left ({\left (2 \, A + C\right )} a + B b\right )} d x + {\left (2 \, C b \cos \left (d x + c\right )^{2} + 6 \, B a + 2 \, {\left (3 \, A + 2 \, C\right )} b + 3 \, {\left (C a + B b\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{6 \, d} \]
1/6*(3*((2*A + C)*a + B*b)*d*x + (2*C*b*cos(d*x + c)^2 + 6*B*a + 2*(3*A + 2*C)*b + 3*(C*a + B*b)*cos(d*x + c))*sin(d*x + c))/d
Leaf count of result is larger than twice the leaf count of optimal. 189 vs. \(2 (73) = 146\).
Time = 0.13 (sec) , antiderivative size = 189, normalized size of antiderivative = 2.36 \[ \int (a+b \cos (c+d x)) \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\begin {cases} A a x + \frac {A b \sin {\left (c + d x \right )}}{d} + \frac {B a \sin {\left (c + d x \right )}}{d} + \frac {B b x \sin ^{2}{\left (c + d x \right )}}{2} + \frac {B b x \cos ^{2}{\left (c + d x \right )}}{2} + \frac {B b \sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{2 d} + \frac {C a x \sin ^{2}{\left (c + d x \right )}}{2} + \frac {C a x \cos ^{2}{\left (c + d x \right )}}{2} + \frac {C a \sin {\left (c + d x \right )} \cos {\left (c + d x \right )}}{2 d} + \frac {2 C b \sin ^{3}{\left (c + d x \right )}}{3 d} + \frac {C b \sin {\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (a + b \cos {\left (c \right )}\right ) \left (A + B \cos {\left (c \right )} + C \cos ^{2}{\left (c \right )}\right ) & \text {otherwise} \end {cases} \]
Piecewise((A*a*x + A*b*sin(c + d*x)/d + B*a*sin(c + d*x)/d + B*b*x*sin(c + d*x)**2/2 + B*b*x*cos(c + d*x)**2/2 + B*b*sin(c + d*x)*cos(c + d*x)/(2*d) + C*a*x*sin(c + d*x)**2/2 + C*a*x*cos(c + d*x)**2/2 + C*a*sin(c + d*x)*co s(c + d*x)/(2*d) + 2*C*b*sin(c + d*x)**3/(3*d) + C*b*sin(c + d*x)*cos(c + d*x)**2/d, Ne(d, 0)), (x*(a + b*cos(c))*(A + B*cos(c) + C*cos(c)**2), True ))
Time = 0.60 (sec) , antiderivative size = 98, normalized size of antiderivative = 1.22 \[ \int (a+b \cos (c+d x)) \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\frac {12 \, {\left (d x + c\right )} A a + 3 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} C a + 3 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} B b - 4 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} C b + 12 \, B a \sin \left (d x + c\right ) + 12 \, A b \sin \left (d x + c\right )}{12 \, d} \]
1/12*(12*(d*x + c)*A*a + 3*(2*d*x + 2*c + sin(2*d*x + 2*c))*C*a + 3*(2*d*x + 2*c + sin(2*d*x + 2*c))*B*b - 4*(sin(d*x + c)^3 - 3*sin(d*x + c))*C*b + 12*B*a*sin(d*x + c) + 12*A*b*sin(d*x + c))/d
Time = 0.31 (sec) , antiderivative size = 76, normalized size of antiderivative = 0.95 \[ \int (a+b \cos (c+d x)) \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=\frac {1}{2} \, {\left (2 \, A a + C a + B b\right )} x + \frac {C b \sin \left (3 \, d x + 3 \, c\right )}{12 \, d} + \frac {{\left (C a + B b\right )} \sin \left (2 \, d x + 2 \, c\right )}{4 \, d} + \frac {{\left (4 \, B a + 4 \, A b + 3 \, C b\right )} \sin \left (d x + c\right )}{4 \, d} \]
1/2*(2*A*a + C*a + B*b)*x + 1/12*C*b*sin(3*d*x + 3*c)/d + 1/4*(C*a + B*b)* sin(2*d*x + 2*c)/d + 1/4*(4*B*a + 4*A*b + 3*C*b)*sin(d*x + c)/d
Time = 2.32 (sec) , antiderivative size = 100, normalized size of antiderivative = 1.25 \[ \int (a+b \cos (c+d x)) \left (A+B \cos (c+d x)+C \cos ^2(c+d x)\right ) \, dx=A\,a\,x+\frac {B\,b\,x}{2}+\frac {C\,a\,x}{2}+\frac {A\,b\,\sin \left (c+d\,x\right )}{d}+\frac {B\,a\,\sin \left (c+d\,x\right )}{d}+\frac {3\,C\,b\,\sin \left (c+d\,x\right )}{4\,d}+\frac {B\,b\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {C\,a\,\sin \left (2\,c+2\,d\,x\right )}{4\,d}+\frac {C\,b\,\sin \left (3\,c+3\,d\,x\right )}{12\,d} \]